﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;

namespace PerfumeShopManagement.View
{
    public partial class frmMain : Form
    {
        public frmMain()
        {
            InitializeComponent();
        }

        private void btnCategoryManagement_Click(object sender, EventArgs e)
        {
            // Show category management form
            frmCategoryManagement categoryManagementView = 
                new frmCategoryManagement();
            categoryManagementView.Visible = true;
            categoryManagementView.FormClosed += new FormClosedEventHandler(categoryManagementView_FormClosed);
            this.Hide();
        }

        void categoryManagementView_FormClosed(object sender, FormClosedEventArgs e)
        {
            this.Visible = true;
        }

        private void btnProductManagement_Click(object sender, EventArgs e)
        {
            // Show product management form
            frmProductManagement productManagementView =
                new frmProductManagement();
            productManagementView.Visible = true;
            productManagementView.FormClosed += new FormClosedEventHandler(productManagementView_FormClosed);
            this.Hide();
        }

        void productManagementView_FormClosed(object sender, FormClosedEventArgs e)
        {
            this.Visible = true;
        }

        private void btnImportCheckManagement_Click(object sender, EventArgs e)
        {
            // Show import check management form
            frmImportCheckManagement importCheckManagementView =
                new frmImportCheckManagement();
            importCheckManagementView.Visible = true;
            importCheckManagementView.FormClosed += new FormClosedEventHandler(importCheckManagementView_FormClosed);
            this.Hide();
        }

        void importCheckManagementView_FormClosed(object sender, FormClosedEventArgs e)
        {
            this.Visible = true;
        }

        private void btnExportManagement_Click(object sender, EventArgs e)
        {
            // Show export check management form
            frmExportCheckManagement exportCheckManagementView =
                new frmExportCheckManagement();
            exportCheckManagementView.Visible = true;
            exportCheckManagementView.FormClosed += new FormClosedEventHandler(exportCheckManagementView_FormClosed);
            this.Hide();
        }

        void exportCheckManagementView_FormClosed(object sender, FormClosedEventArgs e)
        {
            this.Visible = true;
        }

        private void btnAccountManagement_Click(object sender, EventArgs e)
        {
            // Show account management form
            frmAccountManagement accountManagementView =
                new frmAccountManagement();
            accountManagementView.Visible = true;
            accountManagementView.FormClosed += new FormClosedEventHandler(accountManagementView_FormClosed);
            this.Hide();
        }

        void accountManagementView_FormClosed(object sender, FormClosedEventArgs e)
        {
            this.Visible = true;
        }

        private void btnMakingReport_Click(object sender, EventArgs e)
        {
            // Show statistics form
            frmStatistics statisticsView = new frmStatistics();
            statisticsView.Visible = true;
            statisticsView.FormClosed += new FormClosedEventHandler(statisticsView_FormClosed);
            this.Hide();
        }

        void statisticsView_FormClosed(object sender, FormClosedEventArgs e)
        {
            this.Visible = true;
        }
    }
}
